<template>
  <div class="inbound-config-management-container">
    <el-card shadow="never" class="config-card">
      <div class="section-title">基础配置</div>
      <div class="config-section">
        <div class="config-item">
          <el-checkbox v-model="allowReceiveExceeded"/>
          <span>0库存后，货位立刻释放</span>
          <span class="tip-text">（当勾选后，货位库存为0时直接释放库位，仅针对0库存释放库位）</span>
        </div>
        <div class="config-item" v-show="false">
          <el-checkbox v-model="allowReceiveExceeded"/>
          <span>商品条码截取</span>
          <span class="tip-text">（开启后扫描入库、出库验货环节中将商品条码同系统内截取后结果进行比对校验截取前xx位，即匹配系统条码中指定前xx位进行比对校验）</span>
        </div>
        <div class="config-item"  v-show="false" style="padding-left:22px">
          <span>从前往后按位数从</span>
          <el-input v-model="customRatio" class="input-width"/>
          <span>位前截取条码</span>
          <span class="tip-text">（如条码录入123456789，从8位前截取，则条码取1234567）</span>
        </div>
      </div>
    </el-card>
    <div class="action-footer">
      <el-button type="primary" @click="saveConfig">保存</el-button>
    </div>
  </div>
</template>

<script setup>
import {ref} from 'vue'

// 基本配置

const allowReceiveExceeded = ref(false)

const customRatio = ref('')


// 保存配置
const saveConfig = () => {
  console.log('保存入库配置')
  // 实际保存逻辑
}
</script>

<style lang="scss" scoped>
.inbound-config-management-container {
  padding: 0;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;

  .config-card {
    position: relative;
    flex: 1;
    margin: 20px 0 10px 0;
    overflow: visible;

    .section-title {
      position: absolute;
      top: -15px;
      font-size: var(--el-font-size-medium);
      font-weight: bold;
      background-color: #ffffff;
      height: 30px;
      line-height: 30px;
      padding: 0 7px;
    }

    .config-section {
      font-size: var(--el-font-size-base);

      .config-item {
        margin: 10px 0;
        display: flex;
        align-items: center;

        .el-checkbox {
          padding-right: 8px;
        }

        .select-width {
          width: 150px;
        }

        .input-width {
          width: 150px;
          padding: 0 8px;
        }
      }
    }
  }


  .field-input {
    width: 180px;
    margin: 0 10px;
  }

  .tip-text {
    font-size: var(--el-font-size-base);
    color: #3373CA;
  }

  .icon-warning {
    color: #F56C6C;
    font-size: var(--el-font-size-medium);
    margin-left: 5px;
    cursor: pointer;
    position: relative;
  }

  .action-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }
}
</style> 